home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 1999 November / maximum-cd-1999-11.iso / Feature / DR DOS / dr703.exe / LOADFIX.BAT < prev    next >
Encoding:
DOS Batch File  |  1998-12-24  |  4.4 KB  |  124 lines

  1. @ ECHO off
  2.   REM LOADFIX R1.01   Loading applications above low memory (first 64Kb).
  3.   REM Copyright (c) 1997,1998 Caldera, Inc.  All rights reserved.
  4.   REM
  5.   REM Last edit: 98-01-02 MPAUL
  6.   REM
  7.  
  8.   IF ""=="%1" GOTO help
  9.   FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "/H"=="%%x" GOTO help
  10.   FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "-H"=="%%x" GOTO help
  11.   FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "/h"=="%%x" GOTO help
  12.   FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "-h"=="%%x" GOTO help
  13.   FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "/HELP"=="%%x" GOTO help
  14.   FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "-HELP"=="%%x" GOTO help
  15.   FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "/help"=="%%x" GOTO help
  16.   FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "-help"=="%%x" GOTO help
  17.   FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "/Help"=="%%x" GOTO help
  18.   FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "-Help"=="%%x" GOTO help
  19.   IF "/?"=="%1" GOTO help
  20.   IF "-?"=="%1" GOTO help
  21.   IF "/?"=="%2" GOTO help
  22.   IF "-?"=="%2" GOTO help
  23.   IF "/?"=="%3" GOTO help
  24.   IF "-?"=="%3" GOTO help
  25.   IF "/?"=="%4" GOTO help
  26.   IF "-?"=="%4" GOTO help
  27.   IF "/?"=="%5" GOTO help
  28.   IF "-?"=="%5" GOTO help
  29.   IF "/?"=="%6" GOTO help
  30.   IF "-?"=="%6" GOTO help
  31.   IF "/?"=="%7" GOTO help
  32.   IF "-?"=="%7" GOTO help
  33.   IF "/?"=="%8" GOTO help
  34.   IF "-?"=="%8" GOTO help
  35.   IF "/?"=="%9" GOTO help
  36.   IF "-?"=="%9" GOTO help
  37.   IF "?"=="%1" GOTO help
  38.  
  39.   IF NOT "4"=="%@Eval[2+2]%" GOTO start
  40.  
  41.   IF NOT ""=="%/%" FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "%/%H"=="%%x" GOTO help
  42.   IF NOT ""=="%/%" FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "%/%h"=="%%x" GOTO help
  43.   IF NOT ""=="%/%" FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "%/%HELP"=="%%x" GOTO help
  44.   IF NOT ""=="%/%" FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "%/%help"=="%%x" GOTO help
  45.   IF NOT ""=="%/%" FOR %%x IN (%1 %2 %3 %4 %5 %6 %7 %8 %9) DO IF "%/%Help"=="%%x" GOTO help
  46.   IF NOT ""=="%/%" IF "%/%?"=="%1" GOTO help
  47.   IF NOT ""=="%/%" IF "%/%?"=="%2" GOTO help
  48.   IF NOT ""=="%/%" IF "%/%?"=="%3" GOTO help
  49.   IF NOT ""=="%/%" IF "%/%?"=="%4" GOTO help
  50.   IF NOT ""=="%/%" IF "%/%?"=="%5" GOTO help
  51.   IF NOT ""=="%/%" IF "%/%?"=="%6" GOTO help
  52.   IF NOT ""=="%/%" IF "%/%?"=="%7" GOTO help
  53.   IF NOT ""=="%/%" IF "%/%?"=="%8" GOTO help
  54.   IF NOT ""=="%/%" IF "%/%?"=="%9" GOTO help
  55.  
  56. :start
  57.   IF EXIST loadfix.com GOTO loadfix
  58.   ECHO LOADFIX R1.01   Loading applications above low memory (first 64Kb).
  59.   ECHO Copyright (c) 1997,1998 Caldera, Inc.  All rights reserved.
  60.   ECHO.
  61.   REM Force a syntax error to see if MEMMAX complains.
  62.   REM It does so with the new MEMMAX 2.04+, which supports /B.
  63. @ CALL memmax /.>\dev\nul
  64.   IF NOT ERRORLEVEL 1 GOTO old_ver
  65. @ CALL memmax /B>%Temp%\loadfix$.bat
  66.   IF NOT EXIST %Temp%\loadfix$.bat GOTO error
  67.   ECHO Temporarily disabling lower memory for this application...
  68.   ECHO.
  69. @ CALL memmax -L>\dev\nul
  70. @ IF "4"=="%@Eval[2+2]%" GOTO start10
  71. @ IF ""=="%/%" GOTO start10
  72.   REM This may fail if we are not using COMMAND, but that's all we can do...
  73. @ %ComSpec% %/%C %1 %2 %3 %4 %5 %6 %7 %8 %9
  74.   GOTO start20
  75.  
  76. :start10
  77. @ %ComSpec% /C %1 %2 %3 %4 %5 %6 %7 %8 %9
  78.  
  79. :start20
  80. @ IF EXIST %Temp%\loadfix$.bat CALL %Temp%\loadfix$.bat
  81. @ IF EXIST %Temp%\loadfix$.bat DEL %Temp%\loadfix$.bat>\dev\nul
  82.   GOTO end
  83.  
  84. :loadfix
  85. @ CALL loadfix.com %1 %2 %3 %4 %5 %6 %7 %8 %9
  86.   GOTO end
  87.  
  88. :old_ver
  89.   ECHO Error: This older version of MEMMAX is not supported by LOADFIX.
  90.   ECHO        Please use MEMMAX manually.
  91.   ECHO.
  92.   GOTO end
  93.  
  94. :error
  95.   ECHO Error: An error occured using LOADFIX/MEMMAX.
  96.   ECHO        Please use MEMMAX manually.
  97.   ECHO.
  98.   GOTO end
  99.  
  100. :help
  101. @ CALL memmax /H
  102.   ECHO.
  103.   ECHO Some applications have problems when they are run from low memory (with
  104.   ECHO DOS=HIGH). This especially includes programs which have been linked
  105.   ECHO with older versions of MS LINK, or have been compressed by MS EXEPACK.
  106.   ECHO To avoid this problem, LOADFIX can be used to temporarily disable low memory
  107.   ECHO (-L), loading the application above the first 64 Kb. A permanent fix could
  108.   ECHO be to decompress such applications, and compress them using a 3rd party
  109.   ECHO compressor (many utilities have built-in support for this problem).
  110.   ECHO.
  111.   IF "4"=="%@Eval[2+2]%" GOTO help10
  112.   IF ""=="%/%" GOTO help10
  113.   ECHO LOADFIX [%/%H] [program [parameters]]
  114.   ECHO.
  115.   GOTO end
  116.  
  117. :help10
  118.   ECHO LOADFIX [/H] [program [parameters]]
  119.   ECHO.
  120.  
  121. :end
  122.   REM Dummy
  123.   REM Dummy
  124.